import {Graph} from "@antv/x6";

/** 实现边 */ export const SHAPE_SOLID_EDGE_TOP_TO_BOTTOM = 'se_top_to_bottom'
/** 虚线边-padding=12 */ export const SHAPE_DOT_EDGE_12 = 'de_12'
/** 虚线边-padding=13 */ export const SHAPE_DOT_EDGE_13 = 'de_13'

const ROUTER_ARGS_TOP_TO_BOTTOM = {
    startDirections: 'top', endDirections: 'bottom', padding: 20
};

const ROUTER_ARGS_12 = {
    startDirections: 'bottom', endDirections: 'top', padding: 25
};

const ROUTER_ARGS_13 = {
    startDirections: 'bottom', endDirections: 'top', padding: 30
};

const ENTITY_EDGE_TOP_TO_BOTTOM = {
    inherit: 'edge',
    tools: ['vertices'],
    router: {name: 'manhattan', args: ROUTER_ARGS_TOP_TO_BOTTOM}
}

const ENTITY_EDGE_12 = {
    inherit: 'edge',
    tools: ['vertices'],
    router: {name: 'manhattan', args: ROUTER_ARGS_12}
}

const ENTITY_EDGE_13 = {
    inherit: 'edge',
    tools: ['vertices'],
    router: {name: 'manhattan', args: ROUTER_ARGS_13}
}

export default function load_external() {
    Graph.registerEdge(SHAPE_SOLID_EDGE_TOP_TO_BOTTOM, {...ENTITY_EDGE_TOP_TO_BOTTOM, attrs: {line: {strokeWidth: 1}}}, true)
    Graph.registerEdge(SHAPE_DOT_EDGE_12, {...ENTITY_EDGE_12, attrs: {line: {strokeWidth: 1, strokeDasharray: '5 5'}}}, true)
    Graph.registerEdge(SHAPE_DOT_EDGE_13, {...ENTITY_EDGE_13, attrs: {line: {strokeWidth: 1, strokeDasharray: '5 5'}}}, true)
}
